{% extends 'Osso2007Bundle::layout.html.twig' %}

{% block title %}Osso2007 - Game - Edit{% endblock %}

{% block content %}
<div>
<form method="post" action="{{ path('_osso2007_event_edit_post', { 'id': game.id }) }}">
<table border="1">
    <tr><th colspan="2">Which fields and teams to show in the select lists</th></tr>
    <tr><td>Ages</td><td>
        <table border="1" style="margin: 0;"><tr>
        {% for key,desc in ages %}
            <td width="75" align="center">{{ format.genCheckBox('searchData[ages]',searchData.ages,key,desc) | raw }}</td>
        {% endfor %}
        </tr></table>
    </td></tr>
    <tr><td>Genders</td><td>
        <table border="1" style="margin: 0;"><tr>
        {% for key, desc in genders %}
            <td width="75" align="center">{{ format.genCheckBox('searchData[genders]',searchData.genders,key,desc) | raw }}</td>
        {% endfor %}
        </tr></table>
    </td></tr>
    <tr><td>Regions</td><td>
        <table border="1" style="margin: 0;"><tr>
        {% for key,desc in regions %}
            <td width="75" align="center">{{ format.genCheckBox('searchData[regions]',searchData.regions,key,desc) | raw }}</td>
        {% endfor %}
        </tr></table>
    </td></tr>
    <tr><td>&nbsp;</td>
        <td align="right"><input type="submit" name="search_submit" value="Update Teams or Fields" />
    </tr>
</table>
</form>
<form method="post" action="{{ path('_osso2007_event_edit_post', { 'id': game.id }) }}">
<input type="hidden" name="editData[id]"        value="{{game.id}}" />
<input type="hidden" name="editData[num]"       value="{{game.num}}" />
<input type="hidden" name="editData[projectId]" value="{{game.projectId}}" />
<table border="1">
<tr><th colspan="2">Edit Game</th></tr>
<tr>
  <td>Id,Project,Num</td>
  <td>{{game.id}} {{game.projectId}} {{game.num}}</td>
</tr>
<tr>
  <td>Date</td>
  <td>
    <select name="editData[date]">
        <option value="0">Select Date</option>
        {{ format.formOptions(datePickList,game.date) | raw }}
    </select>
  </td>
</tr>
<tr>
  <td>Time</td>
  <td>
    <select name="editData[time]">
        <option value="0">Select Time</option>
        {{ format.formOptions(timePickList,game.time) | raw }}
    </select>
  </td>
</tr>
<tr>
  <td>Field</td>
  <td>
    <select name="editData[fieldId]">
        <option value="0">Select Field</option>
        {{ format.formOptions(fieldPickList,game.fieldId) | raw }}
    </select>
  </td>
</tr>
<tr><td colspan="2">
    <table border="1">
    <tr><td>Team Type</td><td>Score</td><td>Schedule Team Name</td></tr>
        {% for team in game.gameTeams %}
        <input type="hidden" name="editData[teams][{{team.id}}][gameTeamId]" value="{{team.id}}" />
        <tr>
            <td>{{team.teamType}}</td>
            <input type="hidden" name="editData[teams][{{team.id}}][type]" value="{{team.teamType}}" />
            <td><input type="text" name="editData[teams][{{team.id}}][score]" size="3" value="{{team.score}}" />
            <td><select name="editData[teams][{{team.id}}][schTeamId]">
                <option value="0">Select Team</option>
                {{ format.formOptions(schTeamPickList,team.schTeamId) | raw }}
            </select></td>
        </tr>
        {% endfor %}
    </table>
</td></tr>
<tr>
  <td>&nbsp;</td>
    <td align="center">
        <input type="submit" name="clone_submit"  value="Clone" />
        <input type="submit" name="update_submit" value="Update" />
    </td>
</tr>
</table>
</form>
</div>
{% endblock %}
